-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IBD: do not check PoW (Yespower) during Download headers #122
Conversation
2541649
to
67f2b9d
Compare
329c77a
to
24313c5
Compare
This comment has been minimized.
This comment has been minimized.
204f9e5
to
275088d
Compare
This means PoW check during IBD is not actually skipped, but still its checking in another places. What we skipped is only when Downloading headers, but not else. This makes IBD much faster.
275088d
to
032184c
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Looks like a good change to me,i had alot of delay and cpu usage when syncing |
This comment has been minimized.
This comment has been minimized.
Tested ACK 032184c |
IBD around |
reference about if (!x() && !y()) https://stackoverflow.com/questions/8300519/c-if-statement-with-which-function-will-execute-first |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good to me 👍
**Changes: v0.16.3.31rc1** - Major * Fix: IBD `30%` faster, and `60%` reduced data traffic #122 * Add: new option `-prunedebuglogfile`: limit filesize of debug.log #110 * Add: when IBD, print blockheader count on debug.log #128 * Update: checkpoints (mainnet) #132 - Minor * GUI: display size in MB (was GB) #125 * Revert: IBD settings back to BTC original #124 #126
**Changes: v0.16.3.32rc2** - Major * Fix: IBD `30%` faster, and `60%` reduced data traffic #122 * Add: new option `-prunedebuglogfile`: limit filesize of debug.log #110 * Add: when IBD, print blockheader count on debug.log #128 * Update: checkpoints (mainnet) #132 * Fix: IBD optimizing #135 - Minor * GUI: display size in MB (was GB) #125 * Revert: IBD settings back to BTC original #124 #126
**Changes: v33rc3** - Major * Fix: IBD `30%` faster, and `60%` reduced data traffic #122 * Add: new option `-prunedebuglogfile`: limit filesize of debug.log #110 * Add: when IBD, print blockheader count on debug.log #128 * Update: checkpoints (mainnet) #132 * Fix: IBD optimizing #135 * Update: seed list #144 * Remove: BCLog::POW (-debug=pow) #142 - Minor * GUI: display size in MB (was GB) #125 * Revert: IBD settings back to BTC original #124 * Add: bootstrap height at 4421701 #143 * Fix: travis pathlib2 #148
**Changes: v34-starboy (same as v33)** - Major * Fix: IBD `30%` faster, and `60%` reduced data traffic #122 * Add: new option `-prunedebuglogfile`: limit filesize of debug.log #110 * Add: when IBD, print blockheader count on debug.log #128 * Update: checkpoints (mainnet) #132 * Fix: IBD optimizing #135 * Update: seed list #144 * Remove: BCLog::POW (-debug=pow) #142 - Minor * GUI: display size in MB (was GB) #125 * Revert: IBD settings back to BTC original #124 * Add: bootstrap height at 4421701 #143 * Fix: travis pathlib2 #148
* IBD: do not check PoW (Yespower) during downloading headers However this means checking PoW during IBD is, not actually skipped, but still checking in another places. This makes IBD much faster. * remove: debug printf * adding comment by volbil
**Changes: v0.16.3.31rc1** - Major * Fix: IBD `30%` faster, and `60%` reduced data traffic #122 * Add: new option `-prunedebuglogfile`: limit filesize of debug.log #110 * Add: when IBD, print blockheader count on debug.log #128 * Update: checkpoints (mainnet) #132 - Minor * GUI: display size in MB (was GB) #125 * Revert: IBD settings back to BTC original #124 #126
**Changes: v0.16.3.32rc2** - Major * Fix: IBD `30%` faster, and `60%` reduced data traffic #122 * Add: new option `-prunedebuglogfile`: limit filesize of debug.log #110 * Add: when IBD, print blockheader count on debug.log #128 * Update: checkpoints (mainnet) #132 * Fix: IBD optimizing #135 - Minor * GUI: display size in MB (was GB) #125 * Revert: IBD settings back to BTC original #124 #126
**Changes: v33rc3** - Major * Fix: IBD `30%` faster, and `60%` reduced data traffic #122 * Add: new option `-prunedebuglogfile`: limit filesize of debug.log #110 * Add: when IBD, print blockheader count on debug.log #128 * Update: checkpoints (mainnet) #132 * Fix: IBD optimizing #135 * Update: seed list #144 * Remove: BCLog::POW (-debug=pow) #142 - Minor * GUI: display size in MB (was GB) #125 * Revert: IBD settings back to BTC original #124 * Add: bootstrap height at 4421701 #143 * Fix: travis pathlib2 #148
**Changes: v34-starboy (same as v33)** - Major * Fix: IBD `30%` faster, and `60%` reduced data traffic #122 * Add: new option `-prunedebuglogfile`: limit filesize of debug.log #110 * Add: when IBD, print blockheader count on debug.log #128 * Update: checkpoints (mainnet) #132 * Fix: IBD optimizing #135 * Update: seed list #144 * Remove: BCLog::POW (-debug=pow) #142 - Minor * GUI: display size in MB (was GB) #125 * Revert: IBD settings back to BTC original #124 * Add: bootstrap height at 4421701 #143 * Fix: travis pathlib2 #148
* add: option "-prunedebuglogfile": limit filesize of debug.log (#110) The idea is `ShrinkDebugFile` in realtime. - AIM: to prevent disk is filling full up with log file. - DEBUG: If `debug.log` is over 10 MB (`10*1000*1000`), shrink to 1 MB (`1*1000*1000`). 10x smaller * `watch -n1 ls -lh debug.log` * `watch -n5 ps -p "$(cat sugarchaind.pid)" -o %cpu,%mem,cmd` - RUN: check logging speed and filesize * `sugarchaind -prunedebuglogfile -reindex-chainstate` - PERIOD: a cycle took around `4:30` when `-reindex-chainstate` ``` 2020-04-20 23:18:55 DEBUG.LOG PRUNED at 10000071 2020-04-20 23:24:33 DEBUG.LOG PRUNED at 10000014 2020-04-20 23:30:11 DEBUG.LOG PRUNED at 10000018 2020-04-20 23:35:45 DEBUG.LOG PRUNED at 10000186 ``` * IBD: do not check PoW (Yespower) during downloading headers (#122) * IBD: do not check PoW (Yespower) during downloading headers However this means checking PoW during IBD is, not actually skipped, but still checking in another places. This makes IBD much faster. * remove: debug printf * adding comment by volbil * revert: (#80) do not disconnect whitelisted peers during IBD (#124) * GUI: do not display in GB, but in MB (#125) * revert (#78) & fix: disabled more getheaders (#126) * revert&fix: disabled more getheaders * remove: printf * IBD: Print blockheader count on debug.log (#128) * revert: MINIMUM_CONNECT_TIME (#129) https://github.com/bitcoin/bitcoin/blob/f56c00b2345cd2e392ade4733e2ca9cb9b0af623/src/net_processing.h#L36 * Revert "revert: MINIMUM_CONNECT_TIME (#129)" (#130) This reverts commit e37dfec. * update: checkpoint (#132) * bump 0.16.3.31rc1 + manpage (#133) **Changes: v0.16.3.31rc1** - Major * Fix: IBD `30%` faster, and `60%` reduced data traffic #122 * Add: new option `-prunedebuglogfile`: limit filesize of debug.log #110 * Add: when IBD, print blockheader count on debug.log #128 * Update: checkpoints (mainnet) #132 - Minor * GUI: display size in MB (was GB) #125 * Revert: IBD settings back to BTC original #124 #126 * IBD: max blocks in transit per peer (cached PoW) (#135) * bump v0.16.3.32rc2 + manpage (#137) **Changes: v0.16.3.32rc2** - Major * Fix: IBD `30%` faster, and `60%` reduced data traffic #122 * Add: new option `-prunedebuglogfile`: limit filesize of debug.log #110 * Add: when IBD, print blockheader count on debug.log #128 * Update: checkpoints (mainnet) #132 * Fix: IBD optimizing #135 - Minor * GUI: display size in MB (was GB) #125 * Revert: IBD settings back to BTC original #124 #126 * fix: daemon Killed on ARM during IBD (out-of-memory) (#140) * Revert "revert (#78) & fix: disabled more getheaders (#126)" This reverts commit 7c45e62. * comment * remove: BCLog::POW (-debug=pow) (#142) * add: bootstrap height at 4421701 (#143) * scripts: In linearize, search for next position of magic bytes rather than fail bitcoin/bitcoin#16802 * add: bootstrap height at 4421701 * update: seeds 2020-05-19 KST (#144) * fix: travis: pathlib2 (#148) ImportError: No module named 'pathlib2' * doc (#151) * bump v0.16.3.33rc3 + manpage (#152) **Changes: v33rc3** - Major * Fix: IBD `30%` faster, and `60%` reduced data traffic #122 * Add: new option `-prunedebuglogfile`: limit filesize of debug.log #110 * Add: when IBD, print blockheader count on debug.log #128 * Update: checkpoints (mainnet) #132 * Fix: IBD optimizing #135 * Update: seed list #144 * Remove: BCLog::POW (-debug=pow) #142 - Minor * GUI: display size in MB (was GB) #125 * Revert: IBD settings back to BTC original #124 * Add: bootstrap height at 4421701 #143 * Fix: travis pathlib2 #148 * update: blockchain size as 3GB (#153) * cleanup (#154) * comment * seeds version checker * doc: release note v34 starboy (#160) * doc: release note: starboy * fix: known issue * bump: v0.16.3.34-starboy + manpage (#161) **Changes: v34-starboy (same as v33)** - Major * Fix: IBD `30%` faster, and `60%` reduced data traffic #122 * Add: new option `-prunedebuglogfile`: limit filesize of debug.log #110 * Add: when IBD, print blockheader count on debug.log #128 * Update: checkpoints (mainnet) #132 * Fix: IBD optimizing #135 * Update: seed list #144 * Remove: BCLog::POW (-debug=pow) #142 - Minor * GUI: display size in MB (was GB) #125 * Revert: IBD settings back to BTC original #124 * Add: bootstrap height at 4421701 #143 * Fix: travis pathlib2 #148
- Changes: * During IBD, do not download additional block headers, against too much traffic * Skip BIP30 // See: https://github.com/litecoin-project/litecoin/blob/81c4f2d80fbd33d127ff9b31bf588e4925599d79/src/validation.cpp#L1866 * During download headers, do not CheckBlockHeader for performance reason // See sugarchain-project/sugarchain#122 * Rename: Testnet v3 -> v5 // See sugarchain-project/sugarchain@89cf9b5 * During IBD, do not print "Potential stale tip detected..." - Disabled Tests: * feature_uacomment.py * feature_asmap.py - Fixed Tests: * MAX_MONEY
- Changes: * During IBD, do not download additional block headers, against too much traffic * Skip BIP30 // See: https://github.com/litecoin-project/litecoin/blob/81c4f2d80fbd33d127ff9b31bf588e4925599d79/src/validation.cpp#L1866 * During download headers, do not CheckBlockHeader for performance reason // See sugarchain-project/sugarchain#122 * Rename: Testnet v3 -> v5 // See sugarchain-project/sugarchain@89cf9b5 * During IBD, do not print "Potential stale tip detected..." - Disabled Tests: * feature_uacomment.py * feature_asmap.py - Fixed Tests: * MAX_MONEY
- Changes: * During IBD, do not download additional block headers, against too much traffic * Skip BIP30 // See: https://github.com/litecoin-project/litecoin/blob/81c4f2d80fbd33d127ff9b31bf588e4925599d79/src/validation.cpp#L1866 * During download headers, do not CheckBlockHeader for performance reason // See sugarchain-project/sugarchain#122 * Rename: Testnet v3 -> v5 // See sugarchain-project/sugarchain@89cf9b5 * During IBD, do not print "Potential stale tip detected..." - Disabled Tests: * feature_uacomment.py * feature_asmap.py - Fixed Tests: * MAX_MONEY
- Changes: * During IBD, do not download additional block headers, against too much traffic * Skip BIP30 // See: https://github.com/litecoin-project/litecoin/blob/81c4f2d80fbd33d127ff9b31bf588e4925599d79/src/validation.cpp#L1866 * During download headers, do not CheckBlockHeader for performance reason // See sugarchain-project/sugarchain#122 * Rename: Testnet v3 -> v5 // See sugarchain-project/sugarchain@89cf9b5 * During IBD, do not print "Potential stale tip detected..." - Disabled Tests: * feature_uacomment.py * feature_asmap.py - Fixed Tests: * MAX_MONEY
- Changes: * During IBD, do not download additional block headers, against too much traffic * Skip BIP30 // See: https://github.com/litecoin-project/litecoin/blob/81c4f2d80fbd33d127ff9b31bf588e4925599d79/src/validation.cpp#L1866 * During download headers, do not CheckBlockHeader for performance reason // See sugarchain-project/sugarchain#122 * Rename: Testnet v3 -> v5 // See sugarchain-project/sugarchain@89cf9b5 * During IBD, do not print "Potential stale tip detected..." - Disabled Tests: * feature_uacomment.py * feature_asmap.py - Fixed Tests: * MAX_MONEY
- Changes: * During IBD, do not download additional block headers, against too much traffic * Skip BIP30 // See: https://github.com/litecoin-project/litecoin/blob/81c4f2d80fbd33d127ff9b31bf588e4925599d79/src/validation.cpp#L1866 * During download headers, do not CheckBlockHeader for performance reason // See sugarchain-project/sugarchain#122 * Rename: Testnet v3 -> v5 // See sugarchain-project/sugarchain@89cf9b5 * During IBD, do not print "Potential stale tip detected..." - Disabled Tests: * feature_uacomment.py * feature_asmap.py - Fixed Tests: * MAX_MONEY
Background
#119
TL;DR
Safe to skip?
CheckProofOfWork()
is already multiple checking in several place. i believe that even if our node is attacked, it will defense well.RESULT
✔️ total IBD time
++23%
faster✔️ data traffic
--60%
reducedbefore
after
✔️ less CPU usage around
--5%
when IBDWhat we are skipping?
skipped check
CheckProofOfWork()
atpow.cpp
when Downloading headersHow to skip and when?
do not PoW check when Downloading headers of IBD (include
fImporting
andfReindex
). if not, we do not skip.Safe enough?
i believe so. its already multiple checked in
CheckBlock()
and this can be found in 4 places:CLICK ME
AcceptBlock()
TestBlockValidity()
VerifyDB()
ConnectBlock()
Screenshot during IBD